import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/hello")
public class Hello extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        // super.doxxx方法是自动生成的，如果不注释/删掉，就会出现405！！
        // super.doGet(req, resp);

        // 空指针异常：服务器内部错误500！！
        // String s = null;
        // System.out.println(s.length());

        System.out.println("hello Xianmeng!");

        resp.getWriter().write("hello Xianmeng!");
    }
}
